package org.hxyjs.entity;

import java.io.Serializable;

import org.hxyjs.entity.Role;
import org.hxyjs.entity.Account;

/**
 * @author
 */
public class AccountRole implements Serializable {
	private Integer arid;

	private String accountid;

	private Integer roleid;

	private Account account;

	private Role role;

	private static final long serialVersionUID = 1L;

	public Integer getArid() {
		return arid;
	}

	public void setArid(Integer arid) {
		this.arid = arid;
	}

	public String getAccountid() {
		return accountid;
	}

	public void setAccountid(String accountid) {
		this.accountid = accountid;
	}

	public Integer getRoleid() {
		return roleid;
	}

	public void setRoleid(Integer roleid) {
		this.roleid = roleid;
	}

	public Account getAccount() {
		return account;
	}

	public void setAccount(Account account) {
		this.account = account;
	}

	public Role getRole() {
		return role;
	}

	public void setRole(Role role) {
		this.role = role;
	}

	@Override
	public boolean equals(Object that) {
		if (this == that) {
			return true;
		}
		if (that == null) {
			return false;
		}
		if (getClass() != that.getClass()) {
			return false;
		}
		AccountRole other = (AccountRole) that;
		return (this.getArid() == null ? other.getArid() == null : this.getArid().equals(other.getArid()))
				&& (this.getAccountid() == null ? other.getAccountid() == null
				: this.getAccountid().equals(other.getAccountid()))
				&& (this.getRoleid() == null ? other.getRoleid() == null : this.getRoleid().equals(other.getRoleid()));
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + ((getArid() == null) ? 0 : getArid().hashCode());
		result = prime * result + ((getAccountid() == null) ? 0 : getAccountid().hashCode());
		result = prime * result + ((getRoleid() == null) ? 0 : getRoleid().hashCode());
		return result;
	}

	@Override
	public String toString() {
		StringBuilder sb = new StringBuilder();
		sb.append(getClass().getSimpleName());
		sb.append(" [");
		sb.append("Hash = ").append(hashCode());
		sb.append(", arid=").append(arid);
		sb.append(", accountid=").append(accountid);
		sb.append(", roleid=").append(roleid);
		sb.append(", serialVersionUID=").append(serialVersionUID);
		sb.append("]");
		return sb.toString();
	}
}